#include "input.h"

//static struct key_input_gpio input_gpio[3]=
static struct key_input_gpio input_gpio[4]=     //SLJ ADD 4
{
    {
        {
            2,RCC_APB2RSTR_IOPDRST_Pos,
        },
        {
            GPIOD_BASE,3,GPIO_MODE_INPUT,GPIO_SPEED_FREQ_HIGH,GPIO_PULLUP,
        },
        KEY_OK_VALUE,
        1,
    },
    {
        {
            2,RCC_APB2RSTR_IOPDRST_Pos,
        },
        {
            GPIOD_BASE,4,GPIO_MODE_INPUT,GPIO_SPEED_FREQ_HIGH,GPIO_PULLUP,
        },
        KEY_DOWN_VALUE,
        1,
    },
    {
        {
            2,RCC_APB2RSTR_IOPDRST_Pos,
        },
        {
            GPIOD_BASE,5,GPIO_MODE_INPUT,GPIO_SPEED_FREQ_HIGH,GPIO_PULLUP,
        },
        KEY_UP_VALUE,
        1,
    },
    {
        {
            2,RCC_APB2RSTR_IOPDRST_Pos,
        },
        {
            GPIOD_BASE,6,GPIO_MODE_INPUT,GPIO_SPEED_FREQ_HIGH,GPIO_PULLUP,
        },
        KEY_MENU_VALUE,
        1,
    },

};


struct key_input_device_data key_input={
    input_gpio,
    {
        0,0,0,0
    },
    4, //SLJ ADD
    2,
    0,
};



static struct device key_input_device={
    "/dev/input",
    "input",
     0,
    NULL,
    (sj_void *)&key_input,
};


static DEVICE_MODULE_INIT(key_input_device)
